package lab02.test34;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Test34 {
    public static void main(String[] args) {
        List<String> stringList=new ArrayList<String>();
        stringList.add("apple");
        stringList.add("grape");
        stringList.add("banana");
        stringList.add("pear");
        Collections.sort(stringList);
        System.out.println("集合中的最大值："+stringList.get(stringList.size()-1));
        System.out.println("集合中的最小值："+stringList.get(0));
        for (String string :stringList){
            System.out.println(string);
        }

    }
}
